from app import db

class Movie(db.Model):
    __tablename__ = "movie"
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60), nullable=False)  # 电影标题非空
    year = db.Column(db.String(4), nullable=False)  # 年份非空

    def __repr__(self):
        return f"<Movie {self.title} ({self.year})>"